package cn.mynb.dao.impl;

import java.io.Serializable;
import java.util.List;

import cn.mynb.dao.DaoBase;
import cn.mynb.util.HibernateDaoBase;
import cn.mynb.util.PageModel;

public class DaoImplBase<T> extends HibernateDaoBase implements DaoBase<T>{
	
	public int deleteDao(T t) throws Exception {		
		return this.deleteSingleObject(t);
	}

	public List queryAllDao(String hql) throws Exception {
		
		return this.queryAllObject(hql);
	}

	public T queryByIdDao(int id) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}
	/*
	 * (non-Javadoc)
	 * @see cn.mynb.dao.UserDao#queryByParamDao(java.lang.String, java.lang.String, java.util.List, int, int)
	 */
	public PageModel queryByParamDao(String hql, String countHQL,
			List param, int offset, int pageSize) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}
	
	public int saveDao(T t) throws Exception {		
		return this.saveObject(t);
	}

	public Serializable saveSerializableDao(T t) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	public int updateDao(T t) throws Exception {
		// TODO Auto-generated method stub
		return 0;
	}

	@SuppressWarnings("unchecked")
	@Override
	public T querySingleDao(String hql, List param) throws Exception {

		return (T) this.querySingleObject(hql, param);
	}
}
